package cbbx_sm.decision_maker.search;

import java.io.Serializable;


public class SchedulerState implements Serializable {
	String eventStr;
	double[] event;
	public SchedulerState(double[] event){
		this.eventStr = "";
		this.event = new double[event.length];
		int i=0;
		for (double d: event){
			eventStr += d+(((i+1)<event.length)?":":"");
			this.event[i++] = d;
		}
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((eventStr == null) ? 0 : eventStr.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SchedulerState other = (SchedulerState) obj;
		if (eventStr == null) {
			if (other.eventStr != null)
				return false;
		} else if (!eventStr.equals(other.eventStr))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return eventStr;
	}
	
}
